<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>YouTube Cookie Exporter</title>
    <link rel="stylesheet" href="popup.css">
</head>
<body>
    <div class="container">
        <div class="header">
            <h1>🍪 YouTube Cookie Exporter</h1>
            <p>导出YouTube网站的cookie到本地文件</p>
        </div>
        
        <div class="content">
            <div class="status" id="status">
                <div class="status-icon">⏳</div>
                <div class="status-text">准备就绪</div>
            </div>
            
            <div class="controls">
                <button id="exportBtn" class="export-btn">
                    <span class="btn-icon">📥</span>
                    <span class="btn-text">导出Cookie</span>
                </button>
                
                <button id="testConnection" class="test-connection-btn">
                    <span class="btn-icon">🔗</span>
                    <span class="btn-text">测试连接</span>
                </button>
                
                <div class="auto-export-section">
                    <h3>自动刷新设置</h3>
                    <div class="auto-export-controls">
                        <label class="checkbox-container">
                            <input type="checkbox" id="autoExportEnabled">
                            <span class="checkmark"></span>
                            启用自动刷新
                        </label>
                        
                        <div class="interval-setting" id="intervalSetting">
                            <label for="exportInterval">刷新间隔：</label>
                            <select id="exportInterval">
                                <option value="1">1分钟</option>
                                <option value="30">30分钟</option>
                                <option value="60">1小时</option>
                                <option value="120" selected>2小时</option>
                                <option value="240">4小时</option>
                                <option value="480">8小时</option>
                                <option value="720">12小时</option>
                                <option value="1440">24小时</option>
                            </select>
                        </div>
                        
                        <div class="auto-export-status" id="autoExportStatus">
                            <span class="status-text">自动刷新已禁用</span>
                            <span class="next-export" id="nextExportTime"></span>
                        </div>
                        
                        <button id="testAutoExport" class="test-btn" style="display: none;">
                            <span class="btn-icon">🧪</span>
                            <span class="btn-text">测试刷新</span>
                        </button>
                        
                        <button id="resetAutoExport" class="reset-btn" style="display: none;">
                            <span class="btn-icon">🔄</span>
                            <span class="btn-text">重置状态</span>
                        </button>
                        
                        <button id="testRefresh" class="refresh-test-btn" style="display: none;">
                            <span class="btn-icon">🔄</span>
                            <span class="btn-text">测试刷新</span>
                        </button>
                        
                        <button id="testTimer" class="timer-test-btn" style="display: none;">
                            <span class="btn-icon">⏰</span>
                            <span class="btn-text">测试定时器</span>
                        </button>
                    </div>
                </div>
                
                <div class="info">
                    <h3>使用说明：</h3>
                    <ul>
                        <li>确保您在YouTube网站上</li>
                        <li>点击"导出Cookie"按钮手动导出</li>
                        <li>或启用自动刷新功能</li>
                        <li>页面刷新后会自动导出Cookie</li>
                        <li>文件将以Netscape格式下载</li>
                        <li>可用于yt-dlp等工具</li>
                    </ul>
                </div>
            </div>
            
            <div class="footer">
                <small>支持Netscape Cookie格式</small>
            </div>
        </div>
    </div>
    
    <script src="popup.js"></script>
</body>
</html>
